Industrial controllers are special purpose computers used for controlling industrial processes or manufacturing equipment. Under the direction of a stored program the industrial controller examines a series of inputs reflecting the status of a controlled process or controlled equipment, and changes outputs affecting control of the process or equipment. In the simplest case, the inputs and outputs are binary, that is "On" or "Off". However, analog inputs and outputs taking on a continuous range of values and multi-digital values are also used.
An industrial controller differs from a conventional computer in that it is typically necessary to write a wholly new control program or to significantly edit an existing control program for each new controlled process or machine. For this reason it is important that programming the industrial controller be easy and efficient.
Programming an industrial controller is normally performed by using a programming language having specialized instructions adapted to the control process. One such language represents instructions as contacts and coils of relays, the type of devices that the industrial controller might replace. Additional instructions, such as those implementing timers or counters, are also provided as well as many conventional arithmetic instructions common to general purpose computers.
Often it is desirable to add a new instruction to those that may be used to program the industrial controller. The new instructions simplify the task of writing a control program for a particular device or process. In the original industrial controllers, each instruction was executed directly by controller hardware to obtain the maximum execution speed. Adding a new instruction, in such a case, would require a complete redesign of the controller.
In present industrial controllers, each instruction written by the programmer (source program instructions) is compiled into one or more object program instructions which are directly executed in hardware. With these controllers, adding a new instruction to those recognized by the industrial controller requires only a change to the compiler program and no change to the controller hardware itself.
Even so, compilers are complex programs and rewriting a compiler to add a new instruction that it will recognize and compile is difficult and requires an intimate understanding of the operation of the compiler. A rewriting of the compiler is beyond the reach of most users of industrial controllers.
Often it is desired to provide a decompiler for use with the compiler of an industrial controller so that the compiled control program, as held in the industrial controller, may be converted back into editable source code. Rewriting a compiler to add new instructions, as proposed above, would, in this case, also require the additional effort of rewriting the decompiler, a no less difficult task.